﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace PM.Web
{
    public partial class GovNewsInfo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Common.CheckUserOnline();
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["id"]))
                {
                    int id; if (int.TryParse(Request.QueryString["id"], out id))
                    {
                        DataAccess.PmData dal = new DataAccess.PmData();
                        System.Data.DataTable dt = dal.GetGovNews(id);
                        if (dt.Rows.Count > 0)
                        {
                            this.litTitle.Text = dt.Rows[0]["Title"].ToString();
                            this.litContent.Text = dt.Rows[0]["Content"].ToString();
                        }
                        else
                        {
                            this.litContent.Text = "数据不存在！";
                        }
                    }
                    else
                    {
                        this.litContent.Text = "参数错误！";
                    }
                }
                else
                {
                    this.litContent.Text = "参数错误！";
                }
            }
        }
    }
}